import os
import util
from google.appengine.ext import webapp
from google.appengine.api import users
from google.appengine.ext.webapp import template

from Manager import Manager

class MainPage( webapp.RequestHandler ):
	
	@util.loginRequired
	def get( self ):

		manager = Manager()
		achados = manager.meusAchados()

		url = users.create_logout_url( "/" )
		url_linktext = 'Logout'

		template_values = {
			'achados': achados,
			'url': url,
			'url_linktext': url_linktext,
			}

		path = os.path.join( os.path.dirname(__file__), 
			'templates/meusachados.html' )
		self.response.out.write( template.render( path, template_values ) )

